package com.gymjournal

import org.junit.Test

import static junit.framework.Assert.assertEquals
import static junit.framework.Assert.assertNotNull

/**
 * See the API for {@link grails.test.mixin.domain.DomainClassUnitTestMixin} for usage instructions
 */
class GymSetTests {

    @Test
    void testSave() {
        def oneSet = new GymSet(numberOfIteration: 8, operatingWeight: 50)
        def gymnastic = new Gymnastic(customGymnasticType: "biceps").save()

        oneSet.gymnastic = gymnastic

        assertNotNull oneSet.save()
        assertNotNull oneSet.id

        oneSet.note = new Note(content: "very hard")

        assertEquals "very hard", GymSet.findById(oneSet.id).note.content
    }
}
